<FORM method="post" action="/backend/subscribe/save/">
<div class="form">
    <H1>{if $Subscribe->isNew()}Добавление рассылки{else}Редактирование рассылки '{$Subscribe->title}'{/if}</H1>
    <div class="operation"><a href="{$fvConfig->get('dir_web_root')}subscribe/" onclick="go('{$fvConfig->get('dir_web_root')}subscribe/'); return false;" class="left">вернутся к списку</a><div style="clear: both;"></div></div>
<div style="width: 50%; float: left;">

	<fieldset>
        <legend>Контактная информация</legend>
        <label for="title">ФИО</label> <input type="text" id="title" name="m[title]" value="{$Subscribe->title|escape}"/> <br />
        <label for="template_id">Шаблон</label> 
        {html_options name=m[template_id] id=template_id options=$SubscribeTemplatesManager->htmlSelect('title') selected=$Subscribe->template_id}<br />
		<label for="selectedGroups">Группы подписчиков</label>
        <div id="selectedGroups" class="selectedList">
        	<span id="selectedGroupsList" style="font-style: italic;">
        		{foreach item=selectedGroup from=$selectedGroups name=groupsList}
        			{$selectedGroup->group_name}{if !$smarty.foreach.groupsList.last},{/if}
        		{foreachelse}
        			не обрано
        		{/foreach}
        		</span>&nbsp;<span>[<a href="javascript:void(0);" id="selectGroups">обрати</a>] *</span>
        </div>
        <input type="hidden" id="group_id" name="m[group_id]" value='{$Subscribe->group_id|stripslashes}'>
    </fieldset>
    <div class="buttonpanel">
        <input type="submit" name="save" value="Сохранить" class="button"  onclick="$('redirect').value = '';">
        <input type="submit" name="save_and_return" value="Сохранить и выйти" class="button" onclick="$('redirect').value = '1';">
    </div>
    <input type="hidden" name="id" id="id" value="{$Subscribe->getPk()}" />
    <input type="hidden" id="redirect" name="redirect" value="" />
</div>
<div style="clear: both;" />
</div>
</FORM>
{literal}
<script type="text/javascript">
<!--
$('selectGroups').observe('click', function () {
	window.getGroupsWindow().show($F('group_id'));	 
});
//-->
</script>
{/literal}